-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support repeated query params and simplified "csv" cases #304
Conversation
82cd714
to
2f6ab2f
Compare
This MR is a welcome change. I've never been super happy with the way we deal with encoding more complex structs into query parameters, so in general I very much welcome any improvement to the query handling. For this MR in particular, my request is that we have a new test added showing support for this different behavior. |
This change will address #238 as well. |
2f6ab2f
to
db19ea7
Compare
Could you uncomment this line in the
I believe it should test the feature you are adding. Though I'm not 100% sure. It it does not test your feature, could you drop a test in the linked file? |
Excited to see how everything looks once this is rebased on master. |
This allows for leveraging repeated fields in the query via foo=bar&foo=bar2, this also simplifies the "csv" case for repeated strings. Before this using `repeated string foo` in the query would require quoted values `foo="bar","bar2"`, which is a little weird as it departs from how we normally pass values in query params, so as special case for strings (and a more efficient one), `foo=bar,bar2` is supported
expose tests added in #309
db19ea7
to
5891a72
Compare
@adamryman PTAL, I've brought the latest changes with #309 and uncommented the tests. You'll notice that I removed a few cases as these changes do cause a few incompatibilities. Namely quoted array and quoted csv style no longer work for repeated strings. IMO having to do this before was so broken I'm content to call it a bug fix. If not, we can move these changes onto a |
Oh and good call about the clients, tests immediately caught the break there, I've updated the clients to use the new strategies when possible and both causes are already covered in the tests. |
db19ea7
to
5891a72
Compare
I know this is already reviewed, though great job supporting the backwards compatibility! |
This allows for leveraging repeated fields in the query via foo=bar&foo=bar2, this also simplifies the "csv" case for repeated strings. Before this using
repeated string foo
in the query would require quoted valuesfoo="bar","bar2"
, which is a little weird as it departs from how we normally pass values in query params, so as special case for strings (and a more efficient one),foo=bar,bar2
is supportedExample generation using the protos from the
2-repeated
integration testString (note: zero json marshaling required for these)
Non string
Note: the else case above represents the existing code gen, while the else case for string had been optimized and removes the need for
"
, technically an in compatibility